package it.slothy.noveleditor.starter.test;

import java.util.EnumMap;

public class Scoreboard {
	
	private static Integer SET_NULL = -1;
	
	private EnumMap<Entry,Integer> scoreboard;
	private Integer bonus, upTotal, bottomTotal, total;
	
	public Scoreboard(){
		this.scoreboard = new EnumMap<Entry,Integer>(Entry.class);
		for(Entry e : Entry.values())
			this.scoreboard.put(e, SET_NULL);
		
		this.setBonus(0);
		this.setUpTotal(0);
		this.setBottomTotal(0);
		this.setTotal(0);
	}

	public Integer getBonus() {
		return bonus;
	}

	public void setBonus(Integer bonus) {
		this.bonus = bonus;
	}

	public Integer getUpTotal() {
		return upTotal;
	}

	public void setUpTotal(Integer upTotal) {
		this.upTotal = upTotal;
	}

	public Integer getBottomTotal() {
		return bottomTotal;
	}

	public void setBottomTotal(Integer bottomTotal) {
		this.bottomTotal = bottomTotal;
	}

	public Integer getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

	public boolean isComplete() {
		for(Entry e : Entry.values())
			if(this.scoreboard.get(e) == SET_NULL)
				return false;
		
		return true;
	}

}
